package cn.rengy.web.framework.wxmp.component.token;

import cn.rengy.tpa.wxmp.exception.WeChatException;
public interface ComponentTokenService {
	//第三方平台的令牌
	public static final String ACCESS_TOKEN_KEY="component_access_token.";
	//第三方平台的预授权码
	public static final String PRE_AUTH_CODE_KEY="component_pre_auth_code.";
	//授权方的令牌
	public static final String APP_ACCESS_TOKEN_KEY="app_access_token.";
	
	public static final String JSAPITICKET_KEY="app_jsapi_ticket.";
	/**
	 * 获取第三方平台的接口调用令牌
	 * @param component_appid
	 * @return
	 * @throws WeChatException 
	 */
	public String accessToken(String component_appid) throws WeChatException;
	
	/**
	 * 当平台AccessToken不可用时删除
	 * @param component_appid
	 */
	public void evictAccessToken(String component_appid,String value);
	/**
	 * 获取授权码
	 * @param component_appid 第三方平台appid
	 * @return
	 * @throws WeChatException
	 */
	public String preAuthCode(String component_appid) throws WeChatException;
	
	
	/**
	 * 
	 * @param appid 授权方appid
	 * @return
	 * @throws WeChatException
	 */
	public String authAccessToken(String appid) throws WeChatException;
	
	/**
	 * 当授权方authAccessToken不可用时删除
	 * @param appid
	 * @param value
	 */
	public void evictAuthAccessToken(String appid,String value);
	
	
	public String jsApiTicket(String appid) throws WeChatException;
	
	public void evictJsApiTicket(String appid,String value);
}
